package com.dingli.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
@WebListener
public class OnlineListener implements HttpSessionListener {
    int onlineNum = 0;
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        onlineNum++;
        System.out.println("session对象被创建了");
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        System.out.println("session对象被销毁了");
    }
}
